package com.example.hospitalsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.hospitalsystem.pojo.dto.comment.CommentsDto;
import com.example.hospitalsystem.pojo.entity.Comments;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.xml.stream.events.Comment;
import java.util.List;

@Mapper
public interface CommentMapper extends BaseMapper<Comments> {

    @Select("select comment_id as commentId,design_id as designId,user_id as userId,userName,comment_text as commentText,comment_time as commentTime,parent_comment_id as parentCommentId,image from comments where parent_comment_id=#{parentId} and design_id=#{designId}")
    List<CommentsDto> selectCoomment(@Param("parentId") Integer parentId, @Param("designId") Integer designId);
}
